<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style type="text/css" media="print">
        .test{
            display: none;
        }
    </style>
    <style type="text/css" media="screen">
        .test {
            display:block ;
        }
    </style>
</head>
<body>
 
<div class="test">0请右键选择打印预览</div>
<div class="">1请右键选择打印预览</div>
<div class="test">2请右键选择打印预览</div>
<div class="test">3请右键选择打印预览</div>
<div class="">4请右键选择打印预览</div>
</body>
</html>